import json
baseurl="http://127.0.0.1:8000"
def load_Registerdata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        file_data=json.load(f)
        for data in file_data:
            testCase=data.get("testCase")
            username=data.get("username")
            password=data.get("password")
            confirm_password=data.get("confirm_password")
            phone=data.get("phone")
            status_code=data.get("status_code")
            msg=data.get("msg")
            email=data.get("email")
            doctor_id=data.get("doctor_id")
            testdata.append((testCase,username,password,confirm_password,phone,status_code,msg,email,doctor_id))
    return testdata
def load_Logindata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for data in load_data:
        testCase=data.get("testCase")
        username=data.get("username")
        password=data.get("password")
        msg=data.get("msg")
        status_code=data.get("status_code")
        testdata.append((testCase,username,password,msg,status_code))
    return testdata
def load_deviceAdddata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for data in load_data:
        testCase=data.get("testCase")
        device_id=data.get("device_id")
        name=data.get("name")
        msg=data.get("msg")
        status_code=data.get("status_code")
        testdata.append((testCase,device_id,name,msg,status_code))
    return testdata
def load_ecgUploaddata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for ecg_data in load_data:
        testCase=ecg_data.get("testCase")
        device_id=ecg_data.get("device_id")
        data=ecg_data.get("data")
        msg=ecg_data.get("msg")
        status_code=ecg_data.get("status_code")
        timestamps=ecg_data.get("timestamps")
        testdata.append((testCase,device_id,data,msg,status_code,timestamps))
    return testdata
def load_profileUpdatedate(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
    for data in load_data:
        testCase=data.get("testCase")
        email=data.get("email")
        phone=data.get("phone")
        password=data.get("password")
        status_code=data.get("status_code")
        msg=data.get("msg")
        testdata.append((testCase,email,phone,password,status_code,msg))
    return testdata
def load_addPatients(filepath):
    testdata=[]
    with open(filepath,encoding='utf') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            phone=data.get("phone")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,phone,msg,status_code))
        return testdata
def load_updateDoctordata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            username=data.get("username")
            doctor_id=data.get("doctor_id")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,username,doctor_id,msg,status_code))
        return testdata
def load_updateRoledata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            username1=data.get("username1")
            password=data.get("password")
            username2=data.get("username2")
            role=data.get("role")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,username1,password,username2,role,msg,status_code))
        return testdata
def load_resolveAlertdataAll(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            login_name=data.get("login_name")
            login_password=data.get("login_password")
            target_username=data.get("target_username")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,login_name,login_password,target_username,msg,status_code))
        return testdata
def load_resolveAlertdataOne(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            login_name=data.get("login_name")
            login_password=data.get("login_password")
            alert_id=data.get("alert_id")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,login_name,login_password,alert_id,msg,status_code))
        return testdata
def load_logOutdata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            login_name=data.get("login_name")
            login_password=data.get("login_password")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,login_name,login_password,msg,status_code))
        return testdata
def load_deleteDevicedata(filepath):
    testdata=[]
    with open(filepath,encoding='utf-8') as f:
        load_data=json.load(f)
        for data in load_data:
            testCase=data.get("testCase")
            login_name=data.get("login_name")
            login_password=data.get("login_password")
            device_id=data.get("device_id")
            msg=data.get("msg")
            status_code=data.get("status_code")
            testdata.append((testCase,login_name,login_password,device_id,msg,status_code))
        return testdata
def load_terminateRela(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            username = data.get("username")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password, username, msg, status_code))
        return testdata

def load_mainPage(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,msg, status_code))
        return testdata
def load_profile(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,msg, status_code))
        return testdata
def load_devices(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,msg, status_code))
        return testdata
def load_ecg(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,msg, status_code))
        return testdata
def load_getDeviceEcg(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            device_id=data.get("device_id")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,device_id,msg, status_code))
        return testdata
def load_getAlertsId(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            record_id=data.get("record_id")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,record_id,msg, status_code))
        return testdata
def load_getAlerts(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
        for data in load_data:
            testCase = data.get("testCase")
            login_name = data.get("login_name")
            login_password = data.get("login_password")
            user=data.get("user")
            msg = data.get("msg")
            status_code = data.get("status_code")
            testdata.append((testCase, login_name, login_password,user,msg,status_code))
        return testdata

